﻿<!DOCTYPE html>
<html>
    <head>
        <title>@ViewBag.Title</title>
        <link type="text/css" href="@Url.Content("~/Content/Site.css")" rel="stylesheet" />
        <link type="text/css" href="@Url.Content("~/Scripts/Calendar/jquery-ui-1.8.16.custom.css")" rel="stylesheet" />
        <script src="@Url.Content("~/Scripts/jquery-1.4.4.min.js")" type="text/javascript"> </script>
        <script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"> </script>
        <script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"> </script>
        <script src="@Url.Content("~/Scripts/MyScript.js")" type="text/javascript"> </script>
        <script src="@Url.Content("~/Scripts/jquery.autoresize.js")" type="text/javascript"> </script>
        <script src="@Url.Content("~/Scripts/Calendar/jquery-ui-1.8.16.custom.min.js")" type="text/javascript"> </script>
    </head>

    <body>
        <div id="content">
            <div id="logo">
            </div>

            <ul id="menu">
                <li>
                    @if (!HttpContext.Current.User.Identity.IsAuthenticated)
                    {
                        using (Html.BeginForm("LogOn", "Account", new {returnUrl = Request.QueryString["ReturnUrl"]}))
                        {
                            <table>
                                <tr>
                                    <td class="logOnForm">@Html.Encode("Логин: ")</td>
                                    <td>@Html.TextBox("userName", TempData["userName"])</td>
                                </tr>
                                <tr>
                                    <td class="logOnForm">@Html.Encode("Пароль: ")</td>
                                    <td>@Html.Password("password")</td>
                                </tr>
                                <tr>
                                    <td class="errorUsernameOrPassword" colspan="2">
                                        <span>@Html.Encode((string) TempData["errorUsernameOrPassword"])</span>
                                    </td>
                                </tr>
                                <tr>
                                    <td class="logOnForm" colspan="2">
                                        <input class = "singIn" type="submit" value="Войти" />
                                    </td>
                                </tr>
                                <tr>
                                    <td class="logOnForm" colspan="2">
                                        @Html.ActionLink("Регистрация", "Register", "Account")
                                    </td>
                                </tr>
                            </table>
                        }
                    }
                    else
                    {
                        using (Html.BeginForm("LogOff", "Account"))
                        {
                            <table>
                                <tr>
                                    <td>
                                        Здравствуйте,&nbsp;<span style="color: #77B003; font-weight: bold;">@Html.Encode(HttpContext.Current.User.Identity.Name)</span>!
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        <input class="singIn" type="submit" value="Выйти" />
                                    </td>
                                </tr>
                            </table>
                        }
                    }
                </li>
            </ul>

            <div id="left">
                <div class="caption"><p>Меню</p></div>
                <div class="box">
                    <ul>
                        @if (HttpContext.Current.User.Identity.IsAuthenticated)
                        {
                            if (HttpContext.Current.User.IsInRole("Candidate"))
                            {
                                <li>@Html.ActionLink("Поиск вакансий", "Search", "Vacancy")</li>
                                <li>@Html.ActionLink("Мои вакансии", "GetAddCandidateVacancy", "Candidate")</li>
                                <li>@Html.ActionLink("Мои резюме", "ViewResume", "Resume")</li>
                                <li>@Html.ActionLink("Создать резюме", "CreateResume", "Resume")</li>
                            }

                            if (HttpContext.Current.User.IsInRole("Employer"))
                            {
                                <li>@Html.ActionLink("Поиск работников", "Search", "Resume")</li>
                                <li>@Html.ActionLink("Мои вакансии", "ViewVacancy", "Vacancy")</li>
                                <li>@Html.ActionLink("Добавить вакансию", "CreateVacancy", "Vacancy")</li>
                                <li>@Html.ActionLink("Заявки на вакансии", "GetCandidateAddVacancy", "Employer")</li>
                            }
                        }
                        else
                        {
                            <li>@Html.ActionLink("Поиск вакансий", "Search", "Vacancy")</li>
                            <li>@Html.ActionLink("Поиск работников", "Search", "Resume")</li>
                        }

                    </ul>
                </div>
            </div>
     
            <div id="center">
                @RenderBody()
            </div>		

            <div id="footer">
                <div id="fl">
                    Подвал
                </div>
            </div>
        </div>  
    </body>
</html>